Field of the Invention
The present invention relates to a numerical controller, and more particularly, to a numerical controller with look-ahead of a machining program start function based on specified condition.
Description of the Related Art
Numerical controllers of some models are provided with a so-called look-ahead function such that blocks in a program are prefetched onto a memory of each numerical controller in a stage before the program is executed. While this look-ahead function has an advantage that it can minimize the influence of delayed analysis of the program on machining, it may result in various problems if there is any block that should not be analyzed until a machining operation based on its immediately preceding block is completed.
For example, a program O0001 shown in FIG. 7 includes a macro statement “IF[#100EQ1]GOTO 100” using a custom macro variable #100 that is 1 when a tool is located within a predetermined distance from a workpiece. This macro statement is described in the program with an intention to confirm the distance between the tool and the workpiece at the movement end point of the Z-axis. In running the program O0001 designed in this manner, if the macro statement “IF[#100EQ1]GOTO 100” is looked ahead before the Z-axis completes movement from 0.0 to 100.0 in response to a movement command “G00 Z100.0”, the macro statement, unlike the axis movement command, is inevitably executed along with look-ahead/analysis processing. Thus, there is a problem that determination of the IF statement and jump (divergence) of the GOTO statement are inevitably made without succeeding in confirming the distance between the tool and the workpiece in a correct position. Conventionally, in order to avoid this problem, look-ahead is suppressed by using a look-ahead suppression command (“M100” in the program of FIG. 7) so that the macro statement can be read in after the movement of the Z-axis based on the movement command “G00 Z100.0” is completed. Moreover, in a prior art disclosed in Japanese Patent Application Laid-Open No. 2008-040542 or the like, restart of look-ahead after suppression of the look-ahead can be designated block by block.
On the other hand, a high-speed look-ahead suppression command is proposed in addition to a normal look-ahead suppression command (Japanese Patent No. 4271248). The high-speed look-ahead suppression command is designed so that the look-ahead suppression command can be executed at high speed by performing determination of a look-ahead stop code, suspension of look-ahead/analysis processing, and restart of the look-ahead/analysis processing after the termination of execution of the immediately preceding block.
According to the technique disclosed in Japanese Patent Application Laid-Open No. 2008-040542, however, the restart of look-ahead is designated block by block, so that there is a problem that the look-ahead restart cannot easily be controlled by specific values such as the axis position and spindle rotational speed. For example, there is no means for performing look-ahead for a macro statement when the Z-axis reaches any position, e.g., a position 1 mm short of the end point of a block, after issuance of a look-ahead suppression command in the program O0001 shown in FIG. 7, even if such performance is desired. This problem also occurs in the case of a high-speed look-ahead suppression command such as that disclosed in Japanese Patent No. 4271248.